package example

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type HeroRouter struct {}

// InitHeroRouter 初始化 英雄信息 路由信息
func (s *HeroRouter) InitHeroRouter(Router *gin.RouterGroup,PublicRouter *gin.RouterGroup) {
	HRRouter := Router.Group("HR").Use(middleware.OperationRecord())
	HRRouterWithoutRecord := Router.Group("HR")
	HRRouterWithoutAuth := PublicRouter.Group("HR")
	{
		HRRouter.POST("createHero", HRApi.CreateHero)   // 新建英雄信息
		HRRouter.DELETE("deleteHero", HRApi.DeleteHero) // 删除英雄信息
		HRRouter.DELETE("deleteHeroByIds", HRApi.DeleteHeroByIds) // 批量删除英雄信息
		HRRouter.PUT("updateHero", HRApi.UpdateHero)    // 更新英雄信息
	}
	{
		HRRouterWithoutRecord.GET("findHero", HRApi.FindHero)        // 根据ID获取英雄信息
		HRRouterWithoutRecord.GET("getHeroList", HRApi.GetHeroList)  // 获取英雄信息列表
	}
	{
	    HRRouterWithoutAuth.GET("getHeroPublic", HRApi.GetHeroPublic)  // 英雄信息开放接口
	}
}
